// import { login } from '../../api/user'
import { getToken, setToken } from '@/utils/auth'
export default {
  namespaced: true,
  state: {
    token: getToken() || null,
  },
  getters: {},
  mutations: {
    setToken(state, payLoad) {
      state.token = payLoad
      // 持久化
      setToken(payLoad)
    },
  },
  actions: {
    // async login(store, payLoad) {
    //   console.log(payLoad);
    //   const res = await login(payLoad)
    //   //console.log(res---'res')
    //   store.commit('setToken',res.token)
    // },
  },
}
